/*** Eclipse Class Decompiler plugin, copyright (c) 2012 Chao Chen (cnfree2000@hotmail.com) ***/
package com.qihoo.gamecenter.sdk.pay.g;

import android.content.Context;
import com.qihoo.gamecenter.sdk.common.h.d.a;
import com.qihoo.gamecenter.sdk.pay.j.o;
import com.qihoo.gamecenter.sdk.pay.j.o.a;
import com.qihoo.gamecenter.sdk.pay.j.s;
import com.qihoo.gamecenter.sdk.pay.j.s.a;
import com.qihoo.gamecenter.sdk.pay.k.c;
import java.util.ArrayList;
import java.util.Iterator;
import java.util.LinkedList;
import java.util.List;

public class a {
    private static boolean a = false;
    private static boolean b = false;
    private static LinkedList c = new LinkedList();

    public static boolean a() {
        return b;
    }

    public static void a(boolean paramBoolean) {
        b = paramBoolean;
    }

    public static void b() {
        a = false;
        c.clear();
    }

    public static boolean c() {
        return a;
    }

    public static void b(boolean paramBoolean) {
        a = paramBoolean;
    }

    public static void a(List paramList) {
        synchronized (c) {
            c.clear();
            if (paramList != null)
                c.addAll(paramList);
        }
    }

    public static ArrayList d() {
        ArrayList localArrayList = new ArrayList();
        synchronized (c) {
            Iterator localIterator = c.iterator();
            while (localIterator.hasNext())
                localArrayList.add(localIterator.next());
        }
        return localArrayList;
    }

    public static boolean e() {
        return (c.size() > 1);
    }

    public static void a(Context paramContext, String paramString1, String paramString2, String paramString3, d.a parama) {
        c.a("CreditConfig", new Object[] { "@CreditConfig: Get bind cards!" });
        new o(paramContext, new d.a(parama) {
            public void a(int paramInt, String paramString, o.a parama) {
                boolean bool = false;
                if ((paramInt == 0) && (parama != null) && (parama.a() == 0)) {
                    bool = true;
                    ArrayList localArrayList = parama.b();
                    a.a(localArrayList);
                }
                a.b(bool);
                if (this.a == null)
                    return;
                this.a.a(paramInt, paramString, parama);
            }
        }).execute(new String[] { paramString1, paramString2, paramString3 });
    }

    public static void a(Context paramContext, String paramString1, String paramString2, String paramString3, a parama)
  {
    2 local2 = new d.a(paramContext, paramString1, paramString2, paramString3, parama)
    {
      private int f = 0;

      public void a(int paramInt, String paramString, s.a parama)
      {
        this.f += 1;
        String str = paramString;
        if ((paramInt == 0) && (parama != null))
        {
          boolean bool1 = parama.d();
          int i = parama.b();
          str = parama.c();
          if (parama.a() == 0)
          {
            switch (i)
            {
            case 11:
              if (this.f >= 5)
                break label181;
              new s(this.a, this).execute(new String[] { this.b, this.c });
              return;
            case 0:
              boolean bool2 = (bool1) || ((b.d()) && (a.e()));
              a(bool2, 0, str);
              return;
            case 22:
              a(bool1, 2, str);
              return;
            }
            a(bool1, 1, str);
            return;
          }
          label181: a(false, 2, str);
          return;
        }
        a(false, 2, str);
      }

      private void a(boolean paramBoolean, int paramInt, String paramString)
      {
        if (paramBoolean)
        {
          new o(this.a, new d.a()
          {
            public void a(int paramInt, String paramString, o.a parama)
            {
              boolean bool = false;
              if ((paramInt == 0) && (parama != null) && (parama.a() == 0))
              {
                bool = true;
                ArrayList localArrayList = parama.b();
                a.a(localArrayList);
              }
              a.b(bool);
            }
          }).execute(new String[] { this.b, this.d, "pay_reload" });
          a(paramInt, paramString);
        }
        else
        {
          a(paramInt, paramString);
        }
      }

      private void a(int paramInt, String paramString)
      {
        if (this.e == null)
          return;
        this.e.a(paramInt, paramString);
      }
    };
    new s(paramContext, local2).execute(new String[] { paramString1, paramString2 });
  }

    public static abstract interface a {
        public abstract void a(int paramInt, String paramString);
    }
}